<!--复制自member-add,重命名啊，测试完删除-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>发货</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <link rel="stylesheet" href="../lib/layui257/css/layui.css"  media="all">
    <script type="text/javascript" src="js/xadmin.js"></script>
    <script src="../layui/layui.js"></script>
</head>
<body>
<div class="layui-form-item">
    <label class="layui-form-label">寄件人：</label>
    <div class="layui-input-block">
        <input type="text" name="consignor" id="consignor" lay-verify="consignor" autocomplete="off" placeholder="寄件人" class="layui-input">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">收件人：</label>
    <div class="layui-input-block">
        <input type="text" name="consigness" id="consigness" lay-verify="consigness" autocomplete="off" placeholder="收件人" class="layui-input">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">发货地址：</label>
    <div class="layui-input-block">
        <input type="text" name="DeliveryPlace" id="DeliveryPlace" lay-verify="DeliveryPlace" autocomplete="off" placeholder="发货地址" class="layui-input">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">收货地址: </label>
    <div class="layui-input-block">
        <input type="text" name="ReceiptPlace" id="ReceiptPlace" lay-verify="ReceiptPlace" autocomplete="off" placeholder="收货地址" class="layui-input">
    </div>
</div>
<button class="layui-btn" style="margin-left: 25rem" onclick="Commit()">提交</button>
<script>
    function Commit() {//提交数据
        var layedit = layui.layedit;
        $.ajax({
            url: 'http://localhost:8081/Express/addExpress',//请求地址
            dataType: 'JSON',//值类型,
            deliveryWay:'GET',
            data: {
                consigness:$("#consigness").val(),
                consignor:$("#consignor").val(),
                DeliveryPlace:$("#DeliveryPlace").val(),
                ReceiptPlace:$("#ReceiptPlace").val(),
            },//往后端发送的值
            success: function (res) {//成功的回调函数
                if (res.code == "0") {
                    layer.alert("添加成功!")
                } else {
                    layer.alert("添加失败！")
                }
            },
            error: function (data) {//失败的回调函数
                layer.alert("系统出错");
            }
        })
    }
</script>
</body>
</html>